.class public Lcom/instagram/creation/video/f/ax;
.super Lcom/instagram/creation/video/f/ap;
.source "VideoScrubberFragmentICS.java"

# interfaces
.implements Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;
.implements Landroid/media/MediaPlayer$OnSeekCompleteListener;


# annotations
.annotation build Landroid/annotation/TargetApi;
    value = 0xe
.end annotation


# instance fields
.field private Z:I

.field private aa:I

.field private g:Landroid/media/MediaPlayer;

.field private h:Z

.field private i:I


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 19
    invoke-direct {p0}, Lcom/instagram/creation/video/f/ap;-><init>()V

    .line 27
    iput-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->h:Z

    .line 30
    iput v0, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    .line 31
    const/4 v0, -0x1

    iput v0, p0, Lcom/instagram/creation/video/f/ax;->aa:I

    .line 160
    return-void
.end method

.method static synthetic a(Lcom/instagram/creation/video/f/ax;)Landroid/media/MediaPlayer;
    .locals 1
    .parameter

    .prologue
    .line 19
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->g:Landroid/media/MediaPlayer;

    return-object v0
.end method

.method static synthetic a(Lcom/instagram/creation/video/f/ax;Landroid/media/MediaPlayer;)Landroid/media/MediaPlayer;
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 19
    iput-object p1, p0, Lcom/instagram/creation/video/f/ax;->g:Landroid/media/MediaPlayer;

    return-object p1
.end method

.method private a(IZ)Z
    .locals 5
    .parameter
    .parameter

    .prologue
    const/4 v1, 0x1

    const/4 v0, 0x0

    .line 64
    iget-object v2, p0, Lcom/instagram/creation/video/f/ax;->f:Ljava/lang/Object;

    monitor-enter v2

    .line 65
    :try_start_0
    iget-boolean v3, p0, Lcom/instagram/creation/video/f/ax;->e:Z

    if-nez v3, :cond_0

    .line 66
    monitor-exit v2

    .line 84
    :goto_0
    return v0

    .line 68
    :cond_0
    iget-boolean v3, p0, Lcom/instagram/creation/video/f/ax;->h:Z

    if-eqz v3, :cond_1

    .line 69
    monitor-exit v2

    goto :goto_0

    .line 85
    :catchall_0
    move-exception v0

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0

    .line 71
    :cond_1
    const/4 v0, 0x1

    :try_start_1
    iput-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->h:Z

    .line 73
    if-eqz p2, :cond_2

    .line 74
    const/16 v0, 0xc8

    iput v0, p0, Lcom/instagram/creation/video/f/ax;->i:I

    .line 81
    :goto_1
    const-string v0, "VideoScrubberFragmentICS"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Seeking to "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget v4, p0, Lcom/instagram/creation/video/f/ax;->i:I

    sub-int v4, p1, v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v0, v3}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 82
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->g:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->start()V

    .line 83
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->g:Landroid/media/MediaPlayer;

    iget v3, p0, Lcom/instagram/creation/video/f/ax;->i:I

    sub-int v3, p1, v3

    invoke-virtual {v0, v3}, Landroid/media/MediaPlayer;->seekTo(I)V

    .line 84
    monitor-exit v2

    move v0, v1

    goto :goto_0

    .line 76
    :cond_2
    iget v0, p0, Lcom/instagram/creation/video/f/ax;->i:I

    add-int/lit16 v0, v0, 0x3e8

    iput v0, p0, Lcom/instagram/creation/video/f/ax;->i:I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1
.end method


# virtual methods
.method public b(Lcom/instagram/creation/video/gl/l;)V
    .locals 1
    .parameter

    .prologue
    .line 157
    new-instance v0, Lcom/instagram/creation/video/f/ay;

    invoke-direct {v0, p0, p1}, Lcom/instagram/creation/video/f/ay;-><init>(Lcom/instagram/creation/video/f/ax;Lcom/instagram/creation/video/gl/l;)V

    iput-object v0, p0, Lcom/instagram/creation/video/f/ax;->b:Lcom/instagram/creation/video/f/as;

    .line 158
    return-void
.end method

.method protected e(I)V
    .locals 3
    .parameter

    .prologue
    .line 42
    iget v0, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    if-eq p1, v0, :cond_0

    .line 43
    const-string v0, "VideoScrubberFragmentICS"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Showing Frame "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 45
    const/4 v0, 0x1

    invoke-direct {p0, p1, v0}, Lcom/instagram/creation/video/f/ax;->a(IZ)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 46
    iput p1, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    .line 47
    invoke-virtual {p0}, Lcom/instagram/creation/video/f/ax;->X()V

    .line 54
    :cond_0
    :goto_0
    return-void

    .line 51
    :cond_1
    iput p1, p0, Lcom/instagram/creation/video/f/ax;->aa:I

    goto :goto_0
.end method

.method public onFrameAvailable(Landroid/graphics/SurfaceTexture;)V
    .locals 3
    .parameter "surfaceTexture"

    .prologue
    .line 119
    iget-object v1, p0, Lcom/instagram/creation/video/f/ax;->f:Ljava/lang/Object;

    monitor-enter v1

    .line 120
    :try_start_0
    iget-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->e:Z

    if-nez v0, :cond_0

    .line 121
    monitor-exit v1

    .line 147
    :goto_0
    return-void

    .line 124
    :cond_0
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->g:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v0

    iget v2, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    sub-int/2addr v0, v2

    invoke-static {v0}, Ljava/lang/Math;->abs(I)I

    move-result v0

    const/16 v2, 0x64

    if-ge v0, v2, :cond_1

    .line 125
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->c:Z

    .line 126
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->h:Z

    .line 128
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->g:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->pause()V

    .line 130
    invoke-virtual {p0}, Lcom/instagram/creation/video/f/ax;->Y()V

    .line 135
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->b:Lcom/instagram/creation/video/f/as;

    if-eqz v0, :cond_1

    .line 136
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->b:Lcom/instagram/creation/video/f/as;

    invoke-virtual {v0}, Lcom/instagram/creation/video/f/as;->a()Lcom/instagram/creation/video/h/e;

    move-result-object v0

    const/4 v2, 0x1

    invoke-virtual {v0, v2}, Lcom/instagram/creation/video/h/e;->a(Z)V

    .line 137
    iget-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->d:Z

    if-eqz v0, :cond_1

    .line 138
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->b:Lcom/instagram/creation/video/f/as;

    invoke-virtual {v0}, Lcom/instagram/creation/video/f/as;->k()V

    .line 143
    :cond_1
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->b:Lcom/instagram/creation/video/f/as;

    if-eqz v0, :cond_2

    .line 144
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->b:Lcom/instagram/creation/video/f/as;

    invoke-virtual {v0}, Lcom/instagram/creation/video/f/as;->m()V

    .line 146
    :cond_2
    monitor-exit v1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public onProgressChanged(Landroid/widget/SeekBar;IZ)V
    .locals 2
    .parameter "seekBar"
    .parameter "progress"
    .parameter "fromUser"

    .prologue
    .line 151
    if-eqz p3, :cond_0

    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->a:Lcom/instagram/pendingmedia/model/a;

    if-eqz v0, :cond_0

    .line 152
    iget-object v0, p0, Lcom/instagram/creation/video/f/ax;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/a;->h()I

    move-result v0

    mul-int/2addr v0, p2

    div-int/lit8 v0, v0, 0x64

    iget-object v1, p0, Lcom/instagram/creation/video/f/ax;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v1}, Lcom/instagram/pendingmedia/model/a;->f()I

    move-result v1

    add-int/2addr v0, v1

    invoke-virtual {p0, v0}, Lcom/instagram/creation/video/f/ax;->e(I)V

    .line 154
    :cond_0
    return-void
.end method

.method public onSeekComplete(Landroid/media/MediaPlayer;)V
    .locals 5
    .parameter "mp"

    .prologue
    const/4 v4, -0x1

    .line 90
    iget-object v1, p0, Lcom/instagram/creation/video/f/ax;->f:Ljava/lang/Object;

    monitor-enter v1

    .line 91
    :try_start_0
    iget-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->e:Z

    if-nez v0, :cond_0

    .line 92
    monitor-exit v1

    .line 115
    :goto_0
    return-void

    .line 95
    :cond_0
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/creation/video/f/ax;->h:Z

    .line 97
    const-string v0, "VideoScrubberFragmentICS"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Seek Complete at "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 98
    iget v0, p0, Lcom/instagram/creation/video/f/ax;->aa:I

    if-eq v0, v4, :cond_2

    .line 101
    iget v0, p0, Lcom/instagram/creation/video/f/ax;->aa:I

    .line 102
    const/4 v2, -0x1

    iput v2, p0, Lcom/instagram/creation/video/f/ax;->aa:I

    .line 103
    invoke-virtual {p0, v0}, Lcom/instagram/creation/video/f/ax;->e(I)V

    .line 114
    :cond_1
    :goto_1
    monitor-exit v1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0

    .line 104
    :cond_2
    :try_start_1
    iget v0, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    iget v2, p0, Lcom/instagram/creation/video/f/ax;->i:I

    sub-int/2addr v0, v2

    const/16 v2, -0xbb8

    if-ge v0, v2, :cond_3

    .line 107
    invoke-virtual {p1}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v0

    iput v0, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    goto :goto_1

    .line 108
    :cond_3
    invoke-virtual {p1}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v0

    iget v2, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    add-int/lit8 v2, v2, 0x64

    if-le v0, v2, :cond_1

    .line 112
    iget v0, p0, Lcom/instagram/creation/video/f/ax;->Z:I

    const/4 v2, 0x0

    invoke-direct {p0, v0, v2}, Lcom/instagram/creation/video/f/ax;->a(IZ)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1
.end method
